package com.bnlr.lrparking.base;

import android.content.Intent;
import android.support.v4.app.Fragment;

import com.bnlr.lrparking.adapter.HeaderAndFooterRecyclerViewAdapter;
import com.yolanda.nohttp.rest.Request;

import org.json.JSONObject;

/**
 * fragment 基类
 *
 * @author hp
 */
public class BaseFragment extends Fragment {

    /**
     * 网络请求对象.
     */
    public Request<String> mRequest;


    /**
     * 分页加载页数
     */
    public int pageNum = 1;
    /**
     * 是否正在上拉加载中
     */

    /**
     * RecyclerView增加header的adapter
     */
    public HeaderAndFooterRecyclerViewAdapter headerAndFooterAdapter;

    public JSONObject json;

    /**
     * 网络数据请求方法
     */
    public void getData() {
    }

    /**
     * 切换Activity
     *
     * @param c 需要切换到的Activity
     */
    public void startActivity(Class<?> c) {
        Intent intent = new Intent(getActivity(), c);
        this.startActivity(intent);
    }
}
